<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title></title>
<script language="javascript" type="text/javascript" src="http://manager.zyttb.com/Public/Manage/Js/jquery.js"></script>
<script src="http://manager.zyttb.com/Public/Manage/Js/frame.js" language="javascript" type="text/javascript"></script>
<link href="http://manager.zyttb.com/Public/Manage/Css/style.css" rel="stylesheet" type="text/css" />

<!--[if IE 6]>
<script src="http://manager.zyttb.com/Public/Manage/Js/DD_belatedPNG.js" language="javascript" type="text/javascript"></script>
<script>
  DD_belatedPNG.fix('.nav ul li a,.top_link ul li,background');   /* string argument can be any CSS selector */
</script>
<![endif]-->
</head>
<body class="showmenu">
<style type="text/css">
    .layui-layer-tips{width:auto !important;}
</style>
<script src="http://manager.zyttb.com/Public/Manage/Js/common.js" type="text/javascript"></script>
<script src="/Public/Layer/layer.js" type="text/javascript"></script>
<script type="text/javascript">
    function clear_del()
    {
        if(confirm("确定要删除数据吗？"))
        {
            subform("<?php echo U('Member/Lists', 'do=delAll');?>");
        }
    }
</script>
<table width="100%" height="31px" border="0" cellpadding="0" cellspacing="0" class="left_topbg" id="table2">
    <tr>
        <td height="31"><div class="titlebt">会员列表</div></td>
    </tr>
</table>

<div class="main">
    <div class="operate">
        <div class="left">
            <input type="button" onclick="window.open('<?php echo U('Member/Lists',array('do'=>'add'));?>','main')" target="main" class="btn_blue" value="添加">
        </div>
        <div class="left_pad">
            <form method="get" action="<?php echo U('Member/Lists', 'do=Search');?>">
                <input type="text" name="keyword" title="关键字" class="inp_default" value="" placeholder="请输入用户名/手机号/邮箱">
                <input type="submit" class="btn_blue" value="查  询">
            </form>
        </div>
    </div>
    <div class="list">
        <form action="<?php echo U('Game/GameList', 'do=sort');?>" method="post" id="form_do" name="form_do">


            <table width="100%">
                <tr>
                    <!--<th><input  name="chkall" type="checkbox" id="chkall" onClick="selectall(this.form)"></th>-->
                    <th>编号</th>
                    <th style="text-align:left;">用户名</th>
                    <th>电话</th>
                    <th>邮箱</th>
                    <th>状态</th>
                    <th>操作</th>
                </tr>

                <?php if(empty($list)): ?><tr>
                        <td colspan="9">本区域暂无数据显示...</td>
                    </tr>
                    <?php else: ?>
                    <?php if(is_array($list)): $i = 0; $__LIST__ = $list;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$v): $mod = ($i % 2 );++$i;?><tr>
                            <!--<td><input type="checkbox" name="id[]" value="<?php echo ($v["user_id"]); ?>"></td>-->
                            <td><?php echo ($v["user_id"]); ?></td>
                            <td class="aleft">
                                <a href="javascript:;" uid="<?php echo ($v["user_id"]); ?>" class="username" target="_self"><?php echo ($v["user_name"]); ?></a>
                            </td>
                            <td><?php echo ($v["user_phone"]); ?></td>
                            <td><?php echo ($v["user_email"]); ?></td>
                            <td><?php if($v['user_is_disable'] == 0): ?><span class="green">已激活</span><?php else: ?><span class="red">已禁用</span><?php endif; ?></td>
                            <td>
                                <a href="<?php echo U('Member/Lists',array('do'=>'edit','id'=>$v['user_id']));?>">编辑</a>
                                <?php if($v['user_is_disable'] == 0): ?><a href="<?php echo U('Member/Lists',array('do'=>'lock','id'=>$v['user_id'],'page'=>$nowpages));?>" class="delete-one">禁用</a>
                                    <?php else: ?>
                                    <a href="<?php echo U('Member/Lists',array('do'=>'unlock','id'=>$v['user_id'],'page'=>$nowpages));?>" class="active-one">激活</a><?php endif; ?>
                                <!--<a href="<?php echo U('Member/Lists',array('do'=>'log','id'=>$v['user_id']));?>">资金流水</a>-->
                            </td>
                        </tr><?php endforeach; endif; else: echo "" ;endif; endif; ?>


            </table>
        </form>

    </div>

    <div id="page-list" style="text-align: center"></div>

</div>

<script type="text/javascript" src="/Public/Layerpage/laypage.js"></script>
<script type="text/javascript">
    laypage({
        cont: 'page-list',
        pages: <?php echo ($pages); ?>,
        first: 1,
        last: <?php echo ($pages); ?>,
        prev: '<',
        next: '>',
        curr: function(){
            var page = location.search.match(/page=(\d+)/);
            return page ? page[1] : 1;
        }(),
        jump: function(e, first){ //
            if(!first){
                location.href = page() + e.curr;
            }
        }
    });

    function page(){
        var u = location.href;
        var r = '';
        if(u.indexOf('&') > 0){
            r = location.href.replace(/&page=\d+/, '');
            return r + '&page=';
        }else if(u.indexOf('?') > 0 ){
            if(u.indexOf('?page') > 0 ){
                r = location.href.replace(/\?page=\d+/, '');
                return r + '?page=';
            }else{
                return location.href + '&page=';
            }
        }else{
            return location.href + '?page=';
        }
    }

    $('.delete-one').click(function(){
        if( ! window.confirm('确定要禁用此用户吗？') ){
            return false;
        }
    });

    $('.username').click(function(){
        var _this = $(this);
        $.post("<?php echo U('/Api/UserInfo');?>", {
            uid: _this.attr('uid')
        }, function(data){
            layer.tips(data, _this, {
                width: '100%',
                time: 0
            });
            $(document).click(function(){
                layer.closeAll()
            });
        });
    });


</script>
</body>
</html>